<template>
    <div>
      <home-header></home-header>
      <home-swiper :swiperList="swiperList"></home-swiper>
      <home-list :list="list"></home-list>
      <home-comment :hotList="comment"></home-comment>
      <home-where :weekendList="where"></home-where>
    </div>
</template>

<script>
  import homeHeader from "./components/homeHeader";
  import homeSwiper from "./components/homeSwiper";
  import homeList from './components/homeList'
  import homeComment from './components/homeComment'
  import homeWhere from "./components/homeWhere";
  import axios from "axios"
  export default {
    name: "home",
    components: {homeWhere, homeComment, homeList, homeSwiper, homeHeader},
    data(){
      return{
        swiperList:[],
        city:'',
        list:[],
        comment:[],
        where:[]
      }
    },
    methods:{
      getInfo(){
        axios.get('../../../static/mock/index.json').then(this.getInfoSeccuse)
      },
      getInfoSeccuse(res){
        let result=res.data;
        let data=result.data
        if(result.ret){

          this.swiperList=data.swiperList;
          this.list=data.iconList;
          this.comment=data.hotList
          this.where=data.weekendList
        }
      }
    },
    mounted() {
      this.getInfo()  //页面挂载好之后执行函数
    },
  }
</script>

<style scoped lang="stylus">

</style>
